<?php


namespace App\Http\Repositories\Daos\Impls;


use App\Http\Repositories\Daos\IProductSiteDao;
use App\Http\Repositories\Eloquent\ProductSite;

class ProductSiteDao extends BaseDao implements IProductSiteDao
{
    public function __construct(ProductSite $model)
    {
        parent::__construct($model);
    }

    public function lists($search, $page, $size)
    {
        $filterMap = $this->model->newQuery();
        if (isset($search['name']) && !empty($search['name'])) {
            $filterMap->where('name', 'like', '%'.$search['name'].'%');
        }
        $filterMap->where('is_deleted',0);
        return $this->page($filterMap, $page, $size);
    }
}